package com.zh.elec.web.actions;

import java.util.List;

import com.zh.elec.model.Services;
import com.zh.elec.service.ServicesService;
import com.zh.elec.web.actions.base.AbstractAction;

/**
 * 报修表
 * @author scy
 *
 */
public class ServicesAction extends AbstractAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2872660364142463945L;
	private ServicesService servicesService;
	private Services services;
	private List<Services> list;
	/**
	 * 添加
	 * @return
	 */
	public String save(){
		if(services != null){
			services = (Services)servicesService.save(services);
			return "success";
		}
		return "add";
	}
	/**
	 * 修改
	 * @return
	 */
	public String update(){
		services = (Services)servicesService.update(services);
		return "success";
	}
	/**
	 * 删除
	 * @return
	 */
	public String del(){
		services = (Services)servicesService.del(services);
		return "success";
	}
	/**
	 * 查询
	 * @return
	 */
	public String find(){
		list = servicesService.findAll();
		return "success";
	}
	/**
	 * 根据name查询
	 * @return
	 */
	public String findByName(){
		String name = "";
		String value= "";
		List<Services> list = servicesService.findByName(name, value);
		System.out.println(list.size());
		return "success";
	}
	
	public void setServicesService(ServicesService servicesService) {
		this.servicesService = servicesService;
	}
	public Services getServices() {
		return services;
	}
	public void setServices(Services services) {
		this.services = services;
	}
	public List<Services> getList() {
		return list;
	}
	public void setList(List<Services> list) {
		this.list = list;
	}
}
